xen/arm: Use p2m_restore_state in construct_dom0
authorJulien Grall <julien.grall@linaro.org>
Wed, 19 Mar 2014 15:43:38 +0000 (15:43 +0000)
committerIan Campbell <ian.campbell@citrix.com>
Tue, 1 Apr 2014 10:23:42 +0000 (11:23 +0100)
commitd6dd3a9ae7adead322e8ce96f83db96dce64c982
tree94cfe864636e028b6991b16bca17a24a68f85855
parent84ca4629d0aa71dc45c969f625d069373fb88828
xen/arm: Use p2m_restore_state in construct_dom0

The address translation functions used while building dom0 rely on certain EL1
state being configured. In particular they are subject to the behaviour of
SCTLR_EL1.M (stage 1 MMU enabled).

The Xen (and Linux) boot protocol require that the kernel be entered with the
MMU disabled but they don't say anything explicitly about exception levels
other than the one which is active when entering the kernels. Arguably the
protocol could be said to apply to all exception levels but in any case we
should cope with this and setup the EL1 state as necessary.

Fu Wei discovered this when booting Xen from grub.efi over UEFI, it's not
clear whether grub or UEFI is responsible for leaving stage 1 MMU enabled.

Use directly the newly created function p2m_restore_state to retrieve a
correct EL1 state to translate an address.

Signed-off-by: Julien Grall <julien.grall@linaro.org>
Reported-by: Fu Wei <fu.wei@linaro.org>
Acked-by: Tim Deegan <tim@xen.org>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
xen/arch/arm/domain_build.c